import { PassWord, UserName } from "../../dto/user-base-dto";
import { IntersectionType } from '@nestjs/mapped-types';
import { IsDate, IsInt, IsNumber, IsOptional, Min } from "class-validator";
import { Type } from "class-transformer";

export class CreateUserDto extends IntersectionType(UserName,PassWord){
  @IsOptional()
  @Type(() => Number)
  status?: number;

  @IsOptional()
  @Type(() => Date)
  @IsDate()
  birthday?: Date;

  @IsOptional()
  realName?: string;

  @IsOptional()
  phone?: string;

  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(0)
  level?: number
}